define(function(require) {
	var $ = require("jquery");
	var justep = require("$UI/system/lib/justep");
	var ShellImpl = require('$UI/system/lib/portal/shellImpl');
	require("$UI/jwkj-app/appVersionChecker");
	var Model = function() {
		this.callParent();
		var shellImpl = new ShellImpl(this, {
			"contentsXid" : "pages",
			"pageMappings" : {
				"main" : {
					url : require.toUrl('./main.w')
				},
				"login" : {
					url : require.toUrl('./login.w')
				}
			}
		})

	};

	Model.prototype.modelLoad = function(event) {
		var userId = localStorage.getItem("USER_ID");
		console.info(userId);
		if (userId) {
			justep.Shell.showPage("main");
		}else{
			justep.Shell.showPage("login");
		}
		
	};

	return Model;
});